#-*-encoding=utf-8-*-
steps = [
    FlowStep(
        name=u'init',
        title=u'提交',
        fields=[u'doc', u'permission', u'comment'],
        responsibles=u'[request.principal.id]',
    actions=[
        FlowStepAction(
            name=u'submit',
            title=u'提交',
            nextsteps=[u'review'],
            trigger=ur"""
msg_notifier.send('权限申请', 
                 '请求申请文档权限！', 
                 flowsettings['reviewer'],
                 bound_obj=sheet)

"""
)
])
,

    FlowStep(
        name=u'review',
        title=u'审核',
        fields=[u'permission'],
        responsibles=u'flowsettings["reviewer"]',
    actions=[
        FlowStepAction(
            name=u'accept',
            title=u'通过',
            nextsteps=[],
            trigger=ur"""for docid in sheet['doc']:
    doc = intids.getObject(docid)
    IGrantManager(doc).grantRole(sheet['permission'], sheet['creators'][0])
    

msg_notifier.send('您的权限申请通过', 
                 '恭喜！', 
                 sheet['creators'],
                 bound_obj=sheet)

"""
),

        FlowStepAction(
            name=u'reject',
            title=u'打回',
            nextsteps=[],
            trigger=ur"""msg_notifier.send('您的权限申请被打回', 
                 '非常抱歉！', 
                 sheet['creators'],
                 bound_obj=sheet)
"""
)
])
]
